package com.homedo.odin.solution.service.bizservice.personal;

import com.homedo.core.common.util.ObjectConverter;
import com.homedo.odin.solution.contract.pc.BountyMenResp;
import com.homedo.odin.solution.model.dto.BountyMen;
import com.homedo.odin.solution.model.entity.BountyTotal;
import com.homedo.odin.solution.model.entity.BountyTotalBean;
import com.homedo.odin.solution.service.BountyTotalServiceImpl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author: donglibing
 * @date: 2018/3/7 18:58
 * @Description: 悬赏汇总业务处理
 */
@Service
public class BountyTotalBizService {

    @Autowired
    BountyTotalServiceImpl impl;


    /**
     * 悬赏达人列表
     */
    public BountyMenResp getBountyMen(int top) {
        BountyMenResp resp = new BountyMenResp();
        List<BountyTotalBean> bountyMenList = impl.getBountyMen(top);
        resp.setBountyMenList(ObjectConverter.copyList(bountyMenList, BountyMen.class));
        return resp;
    }

    /**
     * 插入悬赏汇总
     */
    public boolean insert(BountyTotal bountyTotalBean) {
        return impl.insert(bountyTotalBean);
    }

    /**
     * 更新悬赏汇总
     */
    public boolean update(BountyTotal bountyTotalBean) {
        return impl.updateById(bountyTotalBean);
    }

}
